package com.slz3.business.module.systemManagement.sysRolePermissions.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysRolePermissions.domain.SysRolePermissions;
import com.slz3.business.module.systemManagement.sysRolePermissions.domain.SysRolePermissionsCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class SysRolePermissionsResController extends SysRolePermissionsResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, SysRolePermissions sysRolePermissions) {
        if (SysRolePermissionsResUnsafeValid.add(req, sysRolePermissions)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$SysRolePermissionsUpdateLock(req, sysRolePermissions);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        if (SysRolePermissionsResUnsafeValid.delete(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, SysRolePermissions sysRolePermissions) {
        if (SysRolePermissionsResUnsafeValid.modify(req, sysRolePermissions)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$SysRolePermissionsUpdateLock(req, sysRolePermissions);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (SysRolePermissionsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return sysRolePermissionsResAtomic.info_$SysRolePermissionsUpdateLock(req);
        if (SysRolePermissionsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$SysRolePermissionsUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (SysRolePermissionsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        //
        if (SysRolePermissionsResUnsafeValid.auditSubmit(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        if (SysRolePermissionsResUnsafeValid.audit(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        if (SysRolePermissionsResUnsafeValid.auditReject(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        if (SysRolePermissionsResUnsafeValid.usingEnable(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, SysRolePermissionsCondition sysRolePermissionsCondition) {
        if (SysRolePermissionsResUnsafeValid.usingDisable(req, sysRolePermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$SysRolePermissionsUpdateLock(req, sysRolePermissionsCondition);
        }
    }

}
